<?php
	session_start();
	$auth = isset($_SESSION['s_auth']['identifikasi_titik']) ? $_SESSION['s_auth']['identifikasi_titik'] : NULL;	
	
	$pancang_id	= isset($_POST['id'])? $_POST['id'] : 1;	
	
	include 'ajax_config.php';
	$x = $db->get_results("SELECT * FROM individu WHERE no_pancang='$pancang_id'", ARRAY_A);
	$x = $x[0];
	usleep(300000);
	
	if( count($x) < 1 ){
?>
<table cellspacing="0" cellpadding="3">
	<tr>
		<td><div align="center">Data tidak ditemukan</div></td>
	</tr>
    <?php
	if( $auth != NULL && $auth != 'view' ){
	?>
	<tr>
		<td><div align="center"><a href="javascript:void(0);" onclick="myInsert.send('id=<?=$pancang_id;?>');">Masukkan Data Baru</a></div></td>
	</tr>			
	<?php
	}
	?>
</table>
<?php
} else {
?>
<table cellspacing="0" cellpadding="3">  
  <tr>
	<td width="150"><div align="justify">No Pancang</div></td>
	<td>:</td>
	<td><?=$x['no_pancang'];?>
	<div align="left"></div></td>
  </tr>
 <tr>
	<td width="150"><div align="justify">No Individu</div></td>
	<td>:</td>
	<td><?=$x['no_individu'];?>
	<div align="left"></div></td>
  </tr> 
  <tr>
	<td width="150"><div align="justify">Tanggal Tanam</div></td>
	<td>:</td>
	<td><?=$x['tgl_tanam'];?>
	<div align="left"></div></td>
  </tr>
  <tr>
	<td width="150"><div align="justify">Replika</div></td>
	<td>:</td>
	<td><?=$x['replika'];?>
	<div align="left"></div></td>
  </tr>
  <tr>
	<td width="150"><div align="justify">Usia Saat Tanam</div></td>
	<td>:</td>
	<td><?=$x['usia_saat_tanam'];?>
	<div align="left"></div></td>
  </tr>
  <tr>
	<td width="150"><div align="justify">Crossing Asal Pokok</div></td>
	<td>:</td>
	<td><?=$x['cross_asal_pokok'];?>
	<div align="left"></div></td>
  </tr>
  <tr>
	<td width="150"><div align="justify">Jenis Tanaman</div></td>
	<td>:</td>
	<td><?=$x['jenis_tanaman'];?>
	<div align="left"></div></td>
  </tr>
  <tr>
	<td width="150"><div align="justify">Ketegori Pokok Saat Tanam</div></td>
	<td>:</td>
	<td><?=$x['kategori_pokok_saat_tanam'];?>
	<div align="left"></div></td>
  </tr>
  <tr>
	<td width="150">&nbsp;</td>
	<td>&nbsp;</td>
	<td><div align="left"></div></td>
  </tr>
  <?php
  if( $auth != NULL && $auth != 'view' ){
  ?>
  <tr>
	<td colspan="3"><div align="center">Action : <a href="javascript:void(0);" onclick="myEdit.send('id=<?=$pancang_id;?>');">Edit</a></div></td>
  </tr>			 
  <?php
  }
  ?>
</table>
<?php
}
?>